home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Graphics Programming (2nd Edition)
/
Visual Basic Graphics Programming 2nd Edition.iso
/
OldSrc
/
CH1
/
SRC
/
OPCODES.FRM
< prev
next >
Wrap
Text File
|
1995-12-13
|
4KB
|
149 lines
VERSION 4.00
Begin VB.Form OpcodeForm
Caption = "Opcodes"
ClientHeight = 3960
ClientLeft = 2085
ClientTop = 1485
ClientWidth = 5070
Height = 4650
Left = 2025
LinkTopic = "Form1"
ScaleHeight = 3960
ScaleWidth = 5070
Top = 855
Width = 5190
Begin VB.PictureBox Source
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 1020
Index = 2
Left = 2520
Picture = "OPCODES.frx":0000
ScaleHeight = 64
ScaleMode = 3 'Pixel
ScaleWidth = 64
TabIndex = 4
Top = 2520
Width = 1020
End
Begin VB.PictureBox Source
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 1020
Index = 1
Left = 2520
Picture = "OPCODES.frx":0882
ScaleHeight = 64
ScaleMode = 3 'Pixel
ScaleWidth = 64
TabIndex = 3
Top = 1440
Width = 1020
End
Begin VB.ListBox OpcodeList
Height = 3765
Left = 120
TabIndex = 2
Top = 120
Width = 2295
End
Begin VB.PictureBox Destination
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 1020
Left = 3960
ScaleHeight = 64
ScaleMode = 3 'Pixel
ScaleWidth = 64
TabIndex = 1
Top = 1440
Width = 1020
End
Begin VB.PictureBox Source
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 1020
Index = 0
Left = 2520
Picture = "OPCODES.frx":1104
ScaleHeight = 64
ScaleMode = 3 'Pixel
ScaleWidth = 64
TabIndex = 0
Top = 360
Width = 1020
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
End
Attribute VB_Name = "OpcodeForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
' ***********************************************
' Add an opcode's name and value to the list of
' choices.
' ***********************************************
Sub AddOpcode(name As String, value As Long)
OpcodeList.AddItem name
OpcodeList.ItemData(OpcodeList.NewIndex) = value
End Sub
Private Sub Form_Load()
Dim copy_index As Integer
' Load the opcode choices.
AddOpcode "vbBlackness", vbBlackness
AddOpcode "vbDstInvert", vbDstInvert
AddOpcode "vbMergeCopy", vbMergeCopy
AddOpcode "vbMergePaint", vbMergePaint
AddOpcode "vbNotSrcCopy", vbNotSrcCopy
AddOpcode "vbSrcErase", vbSrcErase
AddOpcode "vbPatCopy", vbPatCopy
AddOpcode "vbPatInvert", vbPatInvert
AddOpcode "vbPatPaint", vbPatPaint
AddOpcode "vbSrcAnd", vbSrcAnd
AddOpcode "vbSrcCopy", vbSrcCopy
copy_index = OpcodeList.NewIndex
AddOpcode "vbSrcErase", vbSrcErase
AddOpcode "vbSrcInvert", vbSrcInvert
AddOpcode "vbSrcPaint", vbSrcPaint
AddOpcode "vbWhiteness", vbWhiteness
' Start with vbSrcCopy.
OpcodeList.ListIndex = copy_index
End Sub
Private Sub mnuFileExit_Click()
Unload Me
End Sub
Private Sub Source_Click(Index As Integer)
Dim X As Single
Dim Y As Single
Dim wid As Single
Dim hgt As Single
Dim opcode As Long
X = Source(Index).ScaleLeft
Y = Source(Index).ScaleTop
wid = Source(Index).ScaleWidth
hgt = Source(Index).ScaleHeight
opcode = OpcodeList.ItemData(OpcodeList.ListIndex)
With Destination
' Add the source using the chosen opcode.
.PaintPicture Source(Index).Picture, _
.ScaleLeft, .ScaleTop, _
.ScaleWidth, .ScaleHeight, _
X, Y, wid, hgt, opcode
End With
End Sub